xen.git
17 years agoia64: fix make install under tools/debugger/xenitp
Keir Fraser [Wed, 24 Sep 2008 09:19:07 +0000 (10:19 +0100)]
ia64: fix make install under tools/debugger/xenitp

This patch fixes the following error with make install under
the directory, tools/debugger/xenitp by checking whether
the variable is length zero string.

> # make install
> ../../../tools/cross-install -d -m0755 -p //usr/bin
> [ -z " xenitp" ] || ../../../tools/cross-install -d -m0755 -p
> //usr/lib/xen/bin
> ../../../tools/cross-install -d -m0755 -p //usr/share/man/man1
> ../../../tools/cross-install -d -m0755 -p //usr/share/man/man8
> ../../../tools/cross-install -m0755 -p   //usr/bin
> install: too few arguments
> Try `install --help' for more information.
> make: *** [install] Error 1

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agominios: blkfront should set protocol node
Keir Fraser [Wed, 24 Sep 2008 09:18:20 +0000 (10:18 +0100)]
minios: blkfront should set protocol node

From: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxm docs: Added new,delete,dump-core,resume,suspend,uptime and fixed others
Keir Fraser [Wed, 24 Sep 2008 09:17:18 +0000 (10:17 +0100)]
xm docs: Added new,delete,dump-core,resume,suspend,uptime and fixed others

Signed-off-by: Bill Rieske <brieske@novell.com>
17 years agohvm, save/restore: Skip page batches which contain no valid pages.
Keir Fraser [Tue, 23 Sep 2008 16:11:33 +0000 (17:11 +0100)]
hvm, save/restore: Skip page batches which contain no valid pages.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoacm, xend: Catch bad vlan identifiers
Keir Fraser [Tue, 23 Sep 2008 11:30:42 +0000 (12:30 +0100)]
acm, xend: Catch bad vlan identifiers

Add code to intercept badly formatted VLAN identifiers or
those that are out of range.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
17 years agolibxc: Wrapper functions for cpu online/offline
Keir Fraser [Mon, 22 Sep 2008 15:10:25 +0000 (16:10 +0100)]
libxc: Wrapper functions for cpu online/offline

Signed-off-by: Shan Haitao <haitao.shan@intel.com>
17 years agox86: Add sysctl for cpu online/offline
Keir Fraser [Mon, 22 Sep 2008 15:07:04 +0000 (16:07 +0100)]
x86: Add sysctl for cpu online/offline

Signed-off-by: Shan Haitao <haitao.shan@intel.com>
17 years agox86: fix powernow
Keir Fraser [Mon, 22 Sep 2008 14:56:12 +0000 (15:56 +0100)]
x86: fix powernow

... by allocating the necessary cpufreq_policy structures.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agoAdd debug key 'e' for event channel information
Keir Fraser [Mon, 22 Sep 2008 14:50:59 +0000 (15:50 +0100)]
Add debug key 'e' for event channel information

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agoacpi: mark several more items __init/__initdata
Keir Fraser [Mon, 22 Sep 2008 14:33:42 +0000 (15:33 +0100)]
acpi: mark several more items __init/__initdata

Remove unused acpi_reallocate_root_table()

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agox86/cpufreq: don't use static array for large per-CPU data structures
Keir Fraser [Mon, 22 Sep 2008 14:24:03 +0000 (15:24 +0100)]
x86/cpufreq: don't use static array for large per-CPU data structures

... as this is rather wasteful when Xen is configured to support many
CPUs but is running on systems having only a few.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agodomctl: don't allow certain operations on Dom0
Keir Fraser [Mon, 22 Sep 2008 14:20:25 +0000 (15:20 +0100)]
domctl: don't allow certain operations on Dom0

XEN_DOMCTL_setvcpucontext, XEN_DOMCTL_max_vcpus, and
XEN_DOMCTL_setdebugging don't seem to allow Dom0 as the subject domain
(based on the criteria that they pause that domain in order to do
their job).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agovsprintf: Better size_t input checking, and fix return values of
Keir Fraser [Mon, 22 Sep 2008 14:15:19 +0000 (15:15 +0100)]
vsprintf: Better size_t input checking, and fix return values of
[v]scnprintf() when size <= 0.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoFix misc issues related to allowing support of more CPUs
Keir Fraser [Mon, 22 Sep 2008 13:37:31 +0000 (14:37 +0100)]
Fix misc issues related to allowing support of more CPUs

This mainly means removing stack variables that (should) depend on
NR_CPUS (other than cpumask_t ones) and adjusting certain array sizes.

There's at least one open tools issue: The 'xm vcpu-pin' path assumes
a maximum of 64 CPU-s in many places.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agoxentop: Fix display of long domain names.
Keir Fraser [Mon, 22 Sep 2008 13:04:27 +0000 (14:04 +0100)]
xentop: Fix display of long domain names.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoi386: make double fault TSS per-CPU
Keir Fraser [Mon, 22 Sep 2008 13:00:24 +0000 (14:00 +0100)]
i386: make double fault TSS per-CPU

As a follow-up to the per-CPU-GDT patch, this also makes the double
fault TSS (and the associated stack) per-CPU.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agox86: make GDT per-CPU
Keir Fraser [Mon, 22 Sep 2008 12:46:57 +0000 (13:46 +0100)]
x86: make GDT per-CPU

The major issue with supporting a significantly larger number of
physical CPUs appears to be the use of per-CPU GDT entries - at
present, x86-64 could support only up to 126 CPUs (with code changes
to also use the top-most GDT page, that would be 254). Instead of
trying to go with incremental steps here, by converting the GDT itself
to be per-CPU, limitations in that respect go away entirely.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agox86,amd,microcode: fix hypercall return code
Keir Fraser [Mon, 22 Sep 2008 12:41:07 +0000 (13:41 +0100)]
x86,amd,microcode: fix hypercall return code

Make the hypercall return failure if the microcode didn't apply.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years agoCPUIDLE: Handle C2 LAPIC timer & TSC stop
Keir Fraser [Mon, 22 Sep 2008 10:24:02 +0000 (11:24 +0100)]
CPUIDLE: Handle C2 LAPIC timer & TSC stop

ACPI C2 is quite possible mapped to CPU C3 or deeper state, so
thinking from worst cases, enable C3 like entry/exit handling for C2
by default. Option 'lapic_timer_c2_ok' can be used to select simple C2
entry/exit only if the user make sure that LAPIC tmr & TSC will not be
stop during C2.

Signed-off-by: Wei Gang <gang.wei@intel.com>
17 years agoCPUIDLE: Support multiple C3 states
Keir Fraser [Mon, 22 Sep 2008 10:21:31 +0000 (11:21 +0100)]
CPUIDLE: Support multiple C3 states

There may be multiple ACPI C3 states reported by BIOS. Those C3 states
may be different on latency & power. So made some modification to
support this case.

Signed-off-by: Wei Gang <gang.wei@intel.com>
17 years agoxenctx: fix xenctx --all option on x86
Keir Fraser [Mon, 22 Sep 2008 10:16:56 +0000 (11:16 +0100)]
xenctx: fix xenctx --all option on x86

Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
17 years agoxend: Refactor vmmetrics destruction.
Keir Fraser [Mon, 22 Sep 2008 10:15:39 +0000 (11:15 +0100)]
xend: Refactor vmmetrics destruction.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
17 years agopvgrub: Allow to work with a partitionless virtual disc.
Keir Fraser [Thu, 18 Sep 2008 09:43:08 +0000 (10:43 +0100)]
pvgrub: Allow to work with a partitionless virtual disc.

From: Bastian Blank <bastian@waldi.eu.org>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxm list: Return unique exit code for non-existent domain
Keir Fraser [Thu, 18 Sep 2008 09:41:41 +0000 (10:41 +0100)]
xm list: Return unique exit code for non-existent domain

This patch will make xm return a exit code of 3 if `xm list
<non_existant_domain>` is done rather than the generic code of 1.  I
used 3 because XendClient had a macro setup pointing
ERROR_INVALID_DOMAIN to 3.

From: "Shaun R." <mailinglists@unix-scripts.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86, amd, hvm: pass through one more cpuid cache description leaf
Keir Fraser [Thu, 18 Sep 2008 09:39:53 +0000 (10:39 +0100)]
x86, amd, hvm: pass through one more cpuid cache description leaf

Add a missing CPUID leaf that contains AMD-specific cache info.
Without this, Windows can spin trying to prefetch memory buffers using
a stride length of zero.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoRemove internal tools/ioemu tree.
Keir Fraser [Thu, 18 Sep 2008 09:32:40 +0000 (10:32 +0100)]
Remove internal tools/ioemu tree.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxc_save/xc_restore: Fix wrong data type
Keir Fraser [Wed, 17 Sep 2008 13:16:02 +0000 (14:16 +0100)]
xc_save/xc_restore: Fix wrong data type

xc_interface_open() may return -1, but if we define xc_fd as unsigned
int, then -1 will be > 0.

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Allow continue_hypercall_on_cpu() to be called from within an
Keir Fraser [Wed, 17 Sep 2008 13:13:10 +0000 (14:13 +0100)]
x86: Allow continue_hypercall_on_cpu() to be called from within an
existing continuation handler. This fix is needed for the new method
of microcode re-programming.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxm: Remove obsolete mechanism using vncviewer -listen
Keir Fraser [Wed, 17 Sep 2008 12:11:40 +0000 (13:11 +0100)]
xm: Remove obsolete mechanism using vncviewer -listen

Without this patch, vncviewer processes remain as follows.
This patch fixes it.

> # pgrep -fl vnc
> 4303 vncviewer -log *:stdout:0 -listen 5501
> 5089 vncviewer -log *:stdout:0 -listen 5502
> 5763 vncviewer -log *:stdout:0 -listen 5503

details:
Since 21dd1fdb73d8 there have been (as far as I can see) three
separate mechanisms for achieving a VNC display:
 1. xm spawns vncviewer after getting vnc display info
     from qemu-dm via xenstore  (introduced in 21dd1fdb73d8)
 2. xm spawns vncviewer -listen and qemu-dm connects to it
 3. qemu-dm spawns vncviewer (!)

The latter two are rather strange - No.3 is very strange indeed.
So I decided that rather than try to get No.2 or No.3 on track for
going into qemu upstream, No.2 and No.3 would be dropped.
After discussion on xen-devel the mechanism No.1 was introduced,
above.

No.1 is controlled by the --spawn-vncviewer (and --vncviewer-autopass)
command line options to xm, by analogy with the -c option.

Nos.2 and 3 are controlled by elements of the domain configuration
file - and their code still remains.  So if you turn all of the vnc
options on you can get several vncviewers (although only one of them
will work).

This patch removes the support for the passive connection mode No.2
After all ioemu-remote will never connect to such a vncviewer.
The options to engage this functionality were already removed from
the example config files by Keir in 18241:bf4ef45e6a38.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agomini-os: adding some missing posix function declarations
Keir Fraser [Wed, 17 Sep 2008 12:10:36 +0000 (13:10 +0100)]
mini-os: adding some missing posix function declarations

Adding some missing posix function declarations, to get rid of some
qemu-remote compile time warnings.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
17 years agox86-64: enforce memory limits imposed by virtual memory layout
Keir Fraser [Tue, 16 Sep 2008 14:57:22 +0000 (15:57 +0100)]
x86-64: enforce memory limits imposed by virtual memory layout

... which currently means:
- The 1:1 map cannot deal with more than 1Tb.
- The m2p table can handle at most 8Tb.
- The page_info array can cover up to e.g. 1.6Gb (<=3D 64 CPUs) or
  1Tb (193-256 CPUs).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agox86: also fix powernow's dom_mask
Keir Fraser [Tue, 16 Sep 2008 14:54:17 +0000 (15:54 +0100)]
x86: also fix powernow's dom_mask

Just like for the Intel/ACPI cpufreq code, powernow's dom_mask also
must not be confined to the number of CPUs in the system.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agoMerge with IA64 tree.
Keir Fraser [Tue, 16 Sep 2008 12:53:47 +0000 (13:53 +0100)]
Merge with IA64 tree.

17 years agox86, microcode: Free microcode_info struct at end of hypercall.
Keir Fraser [Tue, 16 Sep 2008 12:49:16 +0000 (13:49 +0100)]
x86, microcode: Free microcode_info struct at end of hypercall.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86, microcode: Do not run microcode update in IRQ context.
Keir Fraser [Tue, 16 Sep 2008 12:40:59 +0000 (13:40 +0100)]
x86, microcode: Do not run microcode update in IRQ context.

It's unnecessary, and also invalid since the update process tries to
allocate memory.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agomerge with xen-unstable.hg
Isaku Yamahata [Tue, 16 Sep 2008 12:25:30 +0000 (21:25 +0900)]
merge with xen-unstable.hg

17 years agox86: Simplify RDMSR pass-through emulation for certain
Keir Fraser [Tue, 16 Sep 2008 12:18:32 +0000 (13:18 +0100)]
x86: Simplify RDMSR pass-through emulation for certain
explicitly-named MSRs (but keep the names in the source code in case
we tighten up RDMSR emulation later).

Also add MSR_AMD_PATCHLEVEL MSR as explicitly required (for Solaris).

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86, microcode: More code cleanups.
Keir Fraser [Tue, 16 Sep 2008 12:09:04 +0000 (13:09 +0100)]
x86, microcode: More code cleanups.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agostubdom/ioemu link farm creation fixes
Keir Fraser [Tue, 16 Sep 2008 11:44:26 +0000 (12:44 +0100)]
stubdom/ioemu link farm creation fixes

Replace the stubdom/ioemu link farm creation in stubdom/Makefile,
with code which arranges that:
 * No symlinks are made for output files - in particular, any
   symlinks for .d files would be written through by the compiler
   and cause damage to the original tree and other strange
   behaviours
 * All subdirectories are made as local subdirectories rather than
   links
 * Any interrupted or half-completed creation of the link farm
   leaves the directory in a state where the link farming will be
   restarted
 * We use make's inherent ability to test for the existence of files
   rather than using [ -f ... ] at the start of the rule's commands
 * The list of files to be excluded from the link farm can be
   easily updated
etc.

This should fix some problems particularly with parallel builds,
or by-hand builds where directories are entered in other than the
usual order.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
17 years agox86, microcode: Clean up for Xen coding style, and disable for now
Keir Fraser [Tue, 16 Sep 2008 10:26:19 +0000 (11:26 +0100)]
x86, microcode: Clean up for Xen coding style, and disable for now
(until allocations in irq context are fixed).

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoAvoid parallel invocation of git for ioemu-remote.
Keir Fraser [Mon, 15 Sep 2008 16:10:43 +0000 (17:10 +0100)]
Avoid parallel invocation of git for ioemu-remote.

The stubdom and tools directories both run `make ioemu-dir-find' in
tools.  In a parallel build, both these invocations can run
concurrently because we're doing recursive make.

This change fixes this problem by adding a suitable dependencies in
the top-level Makefile for the recursion into tools/ and stubdom/,
ensuring that the git fetch happens once, first.

The bug was introduced in 18472/18474.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
17 years agox86: Fix 32-bit build after AMD microcode update patch.
Keir Fraser [Mon, 15 Sep 2008 14:44:38 +0000 (15:44 +0100)]
x86: Fix 32-bit build after AMD microcode update patch.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxsm: dummy module - implement missing stub
Keir Fraser [Mon, 15 Sep 2008 10:36:20 +0000 (11:36 +0100)]
xsm: dummy module - implement missing stub

- This minor patch implements the missing stub function
security_label_to_details in the dummy module.  This stub function is
necessary to create domains with network interfaces for modules that
do not implement the security_label_to_details function.

Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
17 years agovtd: minor edge case memory leak
Keir Fraser [Mon, 15 Sep 2008 10:35:20 +0000 (11:35 +0100)]
vtd: minor edge case memory leak

Fixes an (unlikely) memory leak where mapped VT-d root entries are not
unmapped on allocation failure code path.

Signed-off-by: Ross Philipson <ross.philipson@citrix.com>
17 years agox86, shadow: Allow removing writable mappings from splintered page tables.
Keir Fraser [Mon, 15 Sep 2008 10:34:42 +0000 (11:34 +0100)]
x86, shadow: Allow removing writable mappings from splintered page tables.

The moving of the pagetable mapping in the linux kernel exposed the
fact that under the linux kernel sh_rm_write_access_from_sl1p was
always failing.

Linux seems to use big pages to access page tables, so we should
instruct the shadow code to be able to remove writable mappings from
splintered pagetables as well, avoiding using OS heuristic (which were
failing in 2.6.27 before George patch, leading to brute-force search
at each resync).

Signed-off-by: Gianluca Guida <gianluca.guida@eu.citrix.com>
17 years agox86, shadow: Fix comment about Linux direct-map address.
Keir Fraser [Sat, 13 Sep 2008 07:15:26 +0000 (08:15 +0100)]
x86, shadow: Fix comment about Linux direct-map address.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86, shadow: Add new location of Linux direct-map to the places to
Keir Fraser [Fri, 12 Sep 2008 15:45:37 +0000 (16:45 +0100)]
x86, shadow: Add new location of Linux direct-map to the places to
look for writable mappings.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
17 years agox86: microcode update support for AMD CPUs
Keir Fraser [Fri, 12 Sep 2008 13:18:13 +0000 (14:18 +0100)]
x86: microcode update support for AMD CPUs

Microcode update support for AMD CPUs Family10h and Family11h.
It is based on a patch for Linux which is on its way for 2.6.28.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years ago$(XEN_ROOT) absolutification fixes for ioemu-remote (incl stubdom)
Keir Fraser [Fri, 12 Sep 2008 12:15:36 +0000 (13:15 +0100)]
$(XEN_ROOT) absolutification fixes for ioemu-remote (incl stubdom)

 * Move code for generating an absolute version of XEN_ROOT
   into a common make variable set in Config.mk
 * Use this common code when invoking make -C ioemu-dir clean
   from tools/, which avoids a problem where `make clean' fails
   because qemu's (ioemu-remote's) build system wants to run
   `make clean' in `tests' but XEN_ROOT is a confection involving
   ../'s.
 * Use this common code in stubdom/Makefile, instead of $(abspath...)
   as the latter is a relatively new feature in GNU make and is not
   available in all the places that we want to be able to build
   (cf c/s 17997:3f23e01d31985899dbd1660b166f229f1ee74292)

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
17 years agoCheck the existence of serial port before using
Keir Fraser [Fri, 12 Sep 2008 10:43:47 +0000 (11:43 +0100)]
Check the existence of serial port before using

Signed-off-by: Huacai Chen <huacai.chen@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agostubdom: compile stubdom with qemu-remote
Keir Fraser [Fri, 12 Sep 2008 09:41:51 +0000 (10:41 +0100)]
stubdom: compile stubdom with qemu-remote

Remove the CONFIG_QEMU override; fixing lwip isystem path.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
17 years agox86, cpu hotplug: flush softirq work when going offline
Keir Fraser [Fri, 12 Sep 2008 09:40:19 +0000 (10:40 +0100)]
x86, cpu hotplug: flush softirq work when going offline

From: Haitao Shan <haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Clean up cpufreq core logic
Keir Fraser [Fri, 12 Sep 2008 09:34:50 +0000 (10:34 +0100)]
x86: Clean up cpufreq core logic

Clean up cpufreq core logic, which now can cope with cpu
online/offline event, and also dynamic platform limitation event
(_PPC).

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
17 years agomerge with xen-unstable.hg
Isaku Yamahata [Fri, 12 Sep 2008 05:47:40 +0000 (14:47 +0900)]
merge with xen-unstable.hg

17 years ago[IA64] fix XENMEM_add_to_physmap with XENMAPSPACE_mfn
Isaku Yamahata [Fri, 12 Sep 2008 05:32:45 +0000 (14:32 +0900)]
[IA64] fix XENMEM_add_to_physmap with XENMAPSPACE_mfn

In case of XENMEM_add_to_physmap with XENMAPSPACE_mfn,
it triggers BUG_ON(). In fact it breaks some assumptions.
Update BUG_ON() conditions.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agoxenstore: Fix a memory leak in 'xs_is_domain_introduced'.
Keir Fraser [Thu, 11 Sep 2008 17:00:06 +0000 (18:00 +0100)]
xenstore: Fix a memory leak in 'xs_is_domain_introduced'.

Signed-off-by: Konrad Rzeszutek <konrad@virtualiron.com>
17 years agoACPI: Grant access of MSR_IA32_THERM_CONTROL MSR to dom0
Keir Fraser [Thu, 11 Sep 2008 15:51:13 +0000 (16:51 +0100)]
ACPI: Grant access of MSR_IA32_THERM_CONTROL MSR to dom0

The purpose is to support dom0 throttling control via MSR.

Signed-off-by: Wei Gang <gang.wei@intel.com>
17 years agoCPUIDLE: Disable APIC timer intr during C3 while force hpetbroadcast
Keir Fraser [Thu, 11 Sep 2008 15:50:04 +0000 (16:50 +0100)]
CPUIDLE: Disable APIC timer intr during C3 while force hpetbroadcast

It can avoid C3 early exit, and also this is conceptually clearer, as
at given time we only want one clock source to drive timers.

Signed-off-by: Wei Gang <gang.wei@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86, shadow: Fix some SHADOW_PRINTK() callers.
Keir Fraser [Thu, 11 Sep 2008 14:17:31 +0000 (15:17 +0100)]
x86, shadow: Fix some SHADOW_PRINTK() callers.
Signed-off-by: Yoshi Tamura <tamura.yoshiaki@lab.ntt.co.jp>
17 years agoxendomains script: A few bug fixes.
Keir Fraser [Thu, 11 Sep 2008 14:16:11 +0000 (15:16 +0100)]
xendomains script: A few bug fixes.

Contributed-by: Artur Linhart <AL.LINUX@bcpraha.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
17 years agox86: Support CPU hotplug offline.
Keir Fraser [Thu, 11 Sep 2008 14:06:22 +0000 (15:06 +0100)]
x86: Support CPU hotplug offline.

Signed-off-by: Shan Haitao <haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxm: domid casting bug
Keir Fraser [Thu, 11 Sep 2008 10:58:08 +0000 (11:58 +0100)]
xm: domid casting bug

- This patch fixes a small casting bug in xm.  The value of domid was
  not returned as an int, causing commands like 'xm vncviewer domid'
  to fail.

Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
17 years agoxsm: XSM foreigndom usage bug
Keir Fraser [Thu, 11 Sep 2008 10:56:49 +0000 (11:56 +0100)]
xsm: XSM foreigndom usage bug

- This patch corrects an unsafe/incorrect usage of FOREIGNDOM.  The
value of FOREIGNDOM is now passed through the XSM interface.
Corresponding updates to the Flask module are included in this patch.

- This patch also includes a minor header update to allow the Flask
  module to compile after recent updates to Xen.

Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
17 years agox86: Fix calibration rendezvous for cpu hotplug.
Keir Fraser [Wed, 10 Sep 2008 10:26:16 +0000 (11:26 +0100)]
x86: Fix calibration rendezvous for cpu hotplug.

Need to latch cpu_online_map.

From: Haitao Shan <haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoCPUIDLE: Port Linux menu governor to replace the initial ladder governor
Keir Fraser [Wed, 10 Sep 2008 10:18:36 +0000 (11:18 +0100)]
CPUIDLE: Port Linux menu governor to replace the initial ladder governor

The ladder governor has long pro/demotion delay shortcome while
applying to tickless mode, because it needs to count usage. Menu
governor chooses the next state simply via break-event prediction
including the factors of next timer event & last residency time etc,
so it would have faster response speed.

Signed-off-by: Gang Wei <gang.wei@intel.com>
17 years agoCPUIDLE: Adjust Cx residency to contain Cx exit latency & overhead.
Keir Fraser [Wed, 10 Sep 2008 10:17:13 +0000 (11:17 +0100)]
CPUIDLE: Adjust Cx residency to contain Cx exit latency & overhead.

Signed-off-by: Wei Gang <gang.wei@intel.com>
17 years agoCPUIDLE: Avoid remnant LAPIC timer intr while force hpetbroadcast
Keir Fraser [Wed, 10 Sep 2008 10:16:26 +0000 (11:16 +0100)]
CPUIDLE: Avoid remnant LAPIC timer intr while force hpetbroadcast

LAPIC will stop during C3, and resume to work after exit from
C3. Considering below case:
The LAPIC timer was programmed to expire after 1000us, but CPU enter
C3 after 100us and exit C3 at 9xxus.

   0us: reprogram_timer(1000us)
 100us: entry C3, LAPIC timer stop
 9xxus: exit C3 due to unexpected event, LAPIC timer continue running
10xxus: reprogram_timer(1000us), fail due to the past expiring time.
......: no timer softirq raised, no change to LAPIC timer.
......: if entry C3 again, HPET will be forced reprogramed to
 now+small_slop.
......: if entry C2, no change to LAPIC.
18xxus: LAPIC timer expires unexpectedly if no C3 entries after
 10xxus.

Signed-off-by: Wei Gang <gang.wei@intel.com>
17 years agoCPUIDLE: Avoid remnant HPET intr while force hpetbroadcast
Keir Fraser [Wed, 10 Sep 2008 10:09:08 +0000 (11:09 +0100)]
CPUIDLE: Avoid remnant HPET intr while force hpetbroadcast

Exit from C3 is mainly caused by HPET intr if force enable
hpetbroadcast. But it is still probably caused by other unexpected
events. In this case the HPET timer may still be alive while there is
no CPU in C3. Avoid those remnant HPET intr can save cpu handling time
and increase idle time.

Signed-off-by: Wei Gang <gang.wei@intel.com>
17 years agovtd: Add a command line param to enable/disable pass-through feature
Keir Fraser [Wed, 10 Sep 2008 09:53:09 +0000 (10:53 +0100)]
vtd: Add a command line param to enable/disable pass-through feature

Taking security into accout, it's not suitable to bypass VT-d
translation for Dom0 by default when the pass-through field in
extended capability register is set. This feature is for people/usages
who are not overly worried about security/isolation, but want better
performance.

This patch adds a command line param that controls if it's enabled or
disabled.

Signed-off-by: Weidong Han <weidong.han@intel.com>
17 years agox86, xend: Fix processing of cpuid config parameters
Keir Fraser [Wed, 10 Sep 2008 09:51:48 +0000 (10:51 +0100)]
x86, xend: Fix processing of cpuid config parameters

There is an python indentation issue keeping the full range of syntax
for the cpuid config file parameter from working correctly.  This
patch fixes that.  It also fixes some misspelling and a missing 'x' in
two of the example config files (must have 32 bits represented for
cpuid registers).

Signed-off-by: Bruce Rogers <brogers@novell.com>
17 years agox86: Remove MSI boot parameter -- now always on.
Keir Fraser [Wed, 10 Sep 2008 09:47:46 +0000 (10:47 +0100)]
x86: Remove MSI boot parameter -- now always on.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Do not permit 'AUTO_ASSIGN' parameter to PHYSDEVOP_alloc_irq_vector.
Keir Fraser [Tue, 9 Sep 2008 16:28:05 +0000 (17:28 +0100)]
x86: Do not permit 'AUTO_ASSIGN' parameter to PHYSDEVOP_alloc_irq_vector.

It's not needed for MSI handling as Xen hides the vector allocation
and MSI-device programming.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxc_domain_save: Do not poll-wait for guest to shutdown -- it should
Keir Fraser [Tue, 9 Sep 2008 14:33:27 +0000 (15:33 +0100)]
xc_domain_save: Do not poll-wait for guest to shutdown -- it should
already be suspended when the (*suspend)() function returns.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoSmall user manual fixes.
Keir Fraser [Tue, 9 Sep 2008 14:08:57 +0000 (15:08 +0100)]
Small user manual fixes.

From: Stephen Spector <stephen.spector@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoioemu: Fix bug in map cache
Keir Fraser [Tue, 9 Sep 2008 14:05:58 +0000 (15:05 +0100)]
ioemu: Fix bug in map cache

This small patch fixes an issue leading to a crash (segfault, although
with earlier changesets I was seeing sigbus - not sure what changed)
in qemu-dm when the following conditions occur:

1. A valid mapping for a bucket on a low address exists

2. Immediately after accessing memory mapped in this bucket, an access
occurs to a high (beyond assigned ram) address beyond the 1GB limit
for 32bit map cache wrapping around to the previous bucket's entry
number.

3. The next call to map cache again accesses the low address.

In this scenario, the guest mem for the low bucket has been unmapped
by the remap_bucket caused by 2., but because the valid_mapping
bit-test fails, map_cache returns before last_address_index has been
updated. The subsequent call to map_cache therefore never remaps the
low, valid bucket and instead returns a vaddr pointing to memory that
has failed to get mapped.

Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
17 years agoioemu: various fixes to 18394:dade7f0bdc8d
Keir Fraser [Tue, 9 Sep 2008 14:02:51 +0000 (15:02 +0100)]
ioemu: various fixes to 18394:dade7f0bdc8d

- fix ioemu segv with old firmware
  Without notifying ioemu of address, ioemu will segv.

- fix qemu-dm segv with malicous firmware
  If notifying ioemu more than once, ioemu will segv.

Usually such cases don't happen, but malicious guest can
do it intentionally.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agolibxc: fix xc_memory_op(): handles XENMEM_remove_from_phsymap case.
Keir Fraser [Tue, 9 Sep 2008 14:02:32 +0000 (15:02 +0100)]
libxc: fix xc_memory_op(): handles XENMEM_remove_from_phsymap case.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agovtd.txt: Add caveat about assigning certain types of device.
Keir Fraser [Tue, 9 Sep 2008 13:54:56 +0000 (14:54 +0100)]
vtd.txt: Add caveat about assigning certain types of device.

From: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agovtd: Enable pass-through translation for Dom0
Keir Fraser [Tue, 9 Sep 2008 13:50:29 +0000 (14:50 +0100)]
vtd: Enable pass-through translation for Dom0

If pass-through field in extended capability register is set, set
pass-through translation type for Dom0, that means DMA requests with
Untranslated addresses are processed as pass-through in Dom0, needn't
translate DMA requests through a multi-level page-table.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Weidong Han <weidong.han@intel.com>
17 years agostubdom: Fix README for renamed device-model config file.
Keir Fraser [Tue, 9 Sep 2008 13:47:36 +0000 (14:47 +0100)]
stubdom: Fix README for renamed device-model config file.
Sigend-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoRevert 18415:3e72ab517e44 (xend: move the call to XendDevices.destroy_device_state())
Keir Fraser [Tue, 9 Sep 2008 13:45:23 +0000 (14:45 +0100)]
Revert 18415:3e72ab517e44 (xend: move the call to XendDevices.destroy_device_state())

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
17 years agoxentrace 7/7: Add option to log to a circular buffer and dump to disk
Keir Fraser [Mon, 8 Sep 2008 15:02:13 +0000 (16:02 +0100)]
xentrace 7/7: Add option to log to a circular buffer and dump to disk
on signal.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
17 years agoxentrace 6/7: Updated formats file.
Keir Fraser [Mon, 8 Sep 2008 15:00:53 +0000 (16:00 +0100)]
xentrace 6/7: Updated formats file.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
17 years agoxentrace 5/7: Additional tracing for the shadow code.
Keir Fraser [Mon, 8 Sep 2008 14:58:04 +0000 (15:58 +0100)]
xentrace 5/7: Additional tracing for the shadow code.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
17 years agoxentrace 4/7: Add some missing things to the xentrace options string
Keir Fraser [Mon, 8 Sep 2008 14:52:50 +0000 (15:52 +0100)]
xentrace 4/7: Add some missing things to the xentrace options string

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
17 years agoxentrace 3/7: Remove vcpu / domain from HVM traces.
Keir Fraser [Mon, 8 Sep 2008 14:52:03 +0000 (15:52 +0100)]
xentrace 3/7: Remove vcpu / domain from HVM traces.

This information is now redundant, as it can be determined using
runstate changes and lost record changes.  This reduces log size for
long-running traces by 10-30%.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
17 years agoxentrace 2/7: Lost-records record includes currently running vcpu,
Keir Fraser [Mon, 8 Sep 2008 14:50:33 +0000 (15:50 +0100)]
xentrace 2/7: Lost-records record includes currently running vcpu,
and tsc of first lost record.

Including the current vcpu helps us identify who's currently
running on each processor, even if we've lost records.  The tsc of the
first lost record helps us identify how much time we've spent lost,
and also when a pcpu started experiencing lost records.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
17 years agoxentrace 1/7: Trace runstate changes.
Keir Fraser [Mon, 8 Sep 2008 14:47:47 +0000 (15:47 +0100)]
xentrace 1/7: Trace runstate changes.

Also, introduce SCHED_MIN and SCHED_VERBOSE, so that we can trace
just runstate changes if we want to.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
17 years agoxen/powernow: allow using lowest-power P-state
Keir Fraser [Mon, 8 Sep 2008 13:01:35 +0000 (14:01 +0100)]
xen/powernow: allow using lowest-power P-state

The MSR field used here indicates the highest numbered valid P-state,
not the first invalid one.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agox86: fix cpufreq_dom_mask
Keir Fraser [Mon, 8 Sep 2008 13:01:17 +0000 (14:01 +0100)]
x86: fix cpufreq_dom_mask

cpufreq_dom_mask must not be confined to the number of CPUs in the
system - there's nothing disallowing e.g. 1-based domain identifiers
to be used in _PSD. It still remains risky to assume that these
numbers are 'small' and/or not allocated sparsely.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agoxc_save: ignore the first suspend event channel notification
Keir Fraser [Mon, 8 Sep 2008 10:16:23 +0000 (11:16 +0100)]
xc_save: ignore the first suspend event channel notification

I've noticed that the suspend event channel becomes pending as soon as
it is bound. I'm not sure why or whether this is intentional, but it
means that the suspend function will return before the domain has
completed suspending unless the first notification is cleared. Without
this patch, xc_domain_save may find that the guest has not suspended
and sleep in 10ms chunks until it does. Typically this is several
milliseconds of wasted time.

From: Brendan Cully <brendan@cs.ubc.ca>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxc_save: Clean up (*suspend)() callback hook.
Keir Fraser [Mon, 8 Sep 2008 10:13:03 +0000 (11:13 +0100)]
xc_save: Clean up (*suspend)() callback hook.
Sigend-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxc_save: Janitorial work.
Keir Fraser [Mon, 8 Sep 2008 09:55:09 +0000 (10:55 +0100)]
xc_save: Janitorial work.

Remove an unused variable.
Replace errx by warnx when cleanup code follows.

From: Brendan Cully <brendan@cs.ubc.ca>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agolsevtchn: Improve this evtchn reporting tool.
Keir Fraser [Fri, 5 Sep 2008 10:56:35 +0000 (11:56 +0100)]
lsevtchn: Improve this evtchn reporting tool.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoioemu: fix offset of MSI-X memory-mapped table.
Keir Fraser [Fri, 5 Sep 2008 10:18:20 +0000 (11:18 +0100)]
ioemu: fix offset of MSI-X memory-mapped table.

Current code does not set dev->msix->table_off variable.
The offset of MSI-X memory mapped table is treated as 0.
The wrong region is unmapped from guest physical memory space.
As a result, guest device driver can't access memory mapped resource.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
17 years agoxsm: A few hacks to get XSM-disabled (aka dummy) mode working.
Keir Fraser [Thu, 4 Sep 2008 15:29:38 +0000 (16:29 +0100)]
xsm: A few hacks to get XSM-disabled (aka dummy) mode working.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoMore efficient implementation of SCHEDOP_poll when polling a single port.
Keir Fraser [Thu, 4 Sep 2008 13:38:26 +0000 (14:38 +0100)]
More efficient implementation of SCHEDOP_poll when polling a single port.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: smp_mb__{before,after}_clear_bit() are no-ops.
Keir Fraser [Thu, 4 Sep 2008 13:37:56 +0000 (14:37 +0100)]
x86: smp_mb__{before,after}_clear_bit() are no-ops.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxsm: Fix __import__() usage on Python 2.4 and earlier.
Keir Fraser [Thu, 4 Sep 2008 10:55:48 +0000 (11:55 +0100)]
xsm: Fix __import__() usage on Python 2.4 and earlier.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoioemu: support PCI Express Capability Structure version 1.
Keir Fraser [Thu, 4 Sep 2008 10:28:17 +0000 (11:28 +0100)]
ioemu: support PCI Express Capability Structure version 1.
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>